package com.redhipps.hips.client.io;

import com.redhipps.hips.client.HipsTestCase;
import com.redhipps.hips.client.model.Doctor;
import com.redhipps.hips.client.model.DoctorConstraint;
import com.redhipps.hips.client.model.Institution;
import com.redhipps.hips.client.model.Schedule;
import com.redhipps.hips.client.model.ScheduleBlock;
import com.redhipps.hips.client.model.ScheduleSolution;
import com.redhipps.hips.client.model.ScheduleSolutionBlock;

public class IOServiceTest extends HipsTestCase {

  private IOService ioService;

  @Override
  protected void gwtSetUp() throws Exception {
    super.gwtSetUp();
    // TODO Mock request builder factory
    ioService = new IOServiceFactory(new RequestBuilderFactory()).ioService();
  }

  public void testCreateIOService() {
    assertNotNull(ioService);
  }

  public void testGetReaders() {
    assertNotNull(ioService.reader(Institution.class));
    assertNotNull(ioService.reader(Doctor.class));
    assertNotNull(ioService.reader(Schedule.class));
    assertNotNull(ioService.reader(DoctorConstraint.class));
    assertNotNull(ioService.reader(ScheduleBlock.class));
    assertNotNull(ioService.reader(ScheduleSolution.class));
    assertNotNull(ioService.reader(ScheduleSolutionBlock.class));
  }

  public void testGetWriters() {
    assertNotNull(ioService.writer(Institution.class));
    assertNotNull(ioService.writer(Doctor.class));
    assertNotNull(ioService.writer(Schedule.class));
    assertNotNull(ioService.writer(DoctorConstraint.class));
    assertNotNull(ioService.writer(ScheduleBlock.class));
    assertNotNull(ioService.writer(ScheduleSolution.class));
    assertNotNull(ioService.writer(ScheduleSolutionBlock.class));
  }

}
